#ifndef DLISTITER_H_INCLUDED
#define DLISTITER_H_INCLUDED

typedef struct List_t List;
typedef struct ListIter_t* ListIter;

/*Listfor_each perfoms some action of _func on each element in
range: List iterataor _start, List _iterator _finish. (Includes _start and
NOT excludes _finish).
In example after activation of Listfor_each all elements increases at 5

List* list;
.....
int data1=5;

void _func(void* param,void* data1)
{
    *(int*)param+=*(int*)data1;
}

void Listfor_each(Begin(list),ListEnd(list),_func,&data1);*/
typedef void (*Func)(void* param,void* data);
void Listfor_each(ListIter _start,ListIter _finish,Func _func,void* _data);

void* ListGetData(ListIter _iter);

/*if not success returns the LIstIter to the to end*/
ListIter  ListInsert(List* _this,ListIter _iter,void* data);

ListIter ListPrev(ListIter _this);
ListIter ListNext(ListIter _this);

/*Remove Last element*/
void ListPopH(List* _this);
/*Remove Last element*/
void ListPopT(List* _this);

/*Returns boolian answer, true if List empty*/
int ListIsEmpty(List* _this);
/*performance. O(n) .Performs counting of inner elements  */
size_t ListCount(List* _this);

/*Returns Iterator to End (last  element is before End)*/
ListIter ListEnd(List* _this);
/*Returns Iterator to 1st element*/
ListIter Begin(List* _this);

void ListDel(List*_this);
List* ListNew(void);
#endif /* DLISTITER_H_INCLUDED*/
